home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- global int $localHostRenderStatus = 0;
- global int $gNumProcessorsForBatchRender = 1;
- global string $remoteMachineNameToRender = "";
-
- global proc updateHowManyProcs()
- {
- global int $gNumProcessorsForBatchRender;
- int $enabled;
- if (`checkBoxGrp -q -v1 useAllProcs`) {
- $enabled = false;
- $gNumProcessorsForBatchRender = 0;
- } else {
- $enabled = true;
- $gNumProcessorsForBatchRender = `intFieldGrp -q -v1 howManyProcs`;
- }
- intFieldGrp -edit -enable $enabled howManyProcs;
- batchRender -n $gNumProcessorsForBatchRender;
- }
-
- global proc updateBatchRenderWindowTitle()
- {
- global string $gBatchRenderWindow;
-
- if (`window -q -exists $gBatchRenderWindow`) {
-
- string $title;
- if (`getAttr "defaultRenderGlobals.animation"`) {
- $title = "Batch Render Animation";
- } else {
- $title = "Batch Render Frame";
- }
-
- window -edit -t $title $gBatchRenderWindow;
- }
- }
-
- global proc batchRenderWindow()
- {
- global int $gNumProcessorsForBatchRender;
- global int $localHostRenderStatus;
- global string $remoteMachineNameToRender;
-
- global string $gBatchRenderWindow = "batchRenderWnd";
-
- if (! `window -q -exists $gBatchRenderWindow`) {
-
- string $title;
- if (`getAttr "defaultRenderGlobals.animation"`) {
- $title = "Batch Render Animation";
- } else {
- $title = "Batch Render Frame";
- }
-
- window -t $title
- -iconName "Batch Render"
- -rtf true $gBatchRenderWindow;
-
- string $parent = `setParent -query`;
- // Set parent to this window
- setParent $parent;
-
- setUITemplate -pushTemplate DefaultTemplate;
-
- formLayout batchRenderLayout;
-
- // Overall window is layed out as columns
- columnLayout -adj true batchRenderColLayout;
-
- if (!`about -nt` && !`about -mac`) {
- radioButtonGrp -nrb 2
- -l "Rendering CPU"
- -l1 "Local"
- -l2 "Remote"
- -select ($localHostRenderStatus + 1)
- -cc1 "setLocalOrRemoteRender 0; textFieldGrp -e -enable 0 remoteMachineName"
- -cc2 "setLocalOrRemoteRender 1; textFieldGrp -e -enable 1 remoteMachineName"
- localOrRemoteMachine;
- textFieldGrp
- -l "Remote Machine Name"
- -cc "setRemoteRenderMachine"
- -tx $remoteMachineNameToRender
- -enable ($localHostRenderStatus != 0)
- remoteMachineName;
- }
-
- checkBoxGrp -numberOfCheckBoxes 1
- -label1 "Use all Available Processors"
- -v1 ($gNumProcessorsForBatchRender == 0)
- -cc "updateHowManyProcs"
- useAllProcs;
-
- intFieldGrp -label "Number of Processors to Use"
- -cc "updateHowManyProcs"
- -v1 $gNumProcessorsForBatchRender
- -enable ($gNumProcessorsForBatchRender != 0)
- howManyProcs;
-
- setParent ..;
-
- button -l "Batch Render"
- -c "batchRender -f \"\""
- batchRenderButton;
- button -l "Close"
- -c "window -e -visible false $gBatchRenderWindow"
- batchRenderCloseButton;
-
- setParent ..;
-
- formLayout -edit
- -af batchRenderColLayout "top" 5
- -af batchRenderColLayout "left" 5
- -af batchRenderColLayout "right" 5
- -ac batchRenderColLayout "bottom" 5 batchRenderButton
- -af batchRenderButton "left" 5
- -ap batchRenderButton "right" 5 50
- -af batchRenderButton "bottom" 5
- -ap batchRenderCloseButton "left" 5 50
- -af batchRenderCloseButton "right" 5
- -af batchRenderCloseButton "bottom" 5
-
- batchRenderLayout;
-
- setUITemplate -popTemplate;
- }
-
- if ( `about -evalVersion` ) {
- warning( "Maya Personal Learning Edition limits rendering to a single CPU");
- checkBoxGrp -e -enable false -value1 false useAllProcs;
- intFieldGrp -e -enable false -value1 1 howManyProcs;
- }
-
- showWindow $gBatchRenderWindow;
- }
-
-
- global proc setRemoteRenderMachine() {
- global string $remoteMachineNameToRender;
- string $remoteName = `textFieldGrp -q -tx remoteMachineName`;
- batchRender -rm $remoteName;
- $remoteMachineNameToRender = $remoteName;
- }
-
- global proc setLocalOrRemoteRender(int $status) {
- global int $localHostRenderStatus;
- batchRender -um $status;
- $localHostRenderStatus = $status;
- }
-